//////////////////////////////////////////////////////////////////////////
///	\file:	CETool.h
///	Copyright (MingYou) 2009 - All Rights Reserved
///	Author:	Robert.Ma
///	Date:	[2009/05/13]
///	Description:
///		
//////////////////////////////////////////////////////////////////////////
#pragma once

#pragma comment(lib, "cemapi.lib")

namespace CETool
{
	BOOL EstablishConnection(const GUID* pDestNet, HANDLE& hConnection);

	BOOL SendSMSMessage(LPCTSTR lpszRecipient,
	                    LPCTSTR lpszMessage,
	                    BOOL bSendConfirmation = FALSE,
	                    BOOL bUseDefaultSMSC = TRUE,
	                    LPCTSTR lpszSMSC = NULL);

	BOOL SendSMSMessageAsync(LPCTSTR lpszRecipient,
	                         LPCTSTR lpszMessage,
	                         BOOL bSendConfirmation = FALSE,
	                         BOOL bUseDefaultSMSC = TRUE,
	                         LPCTSTR lpszSMSC = NULL);

	BOOL DoSendMessage(LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszMessage);

	BOOL LanchSystemSmsEditor(const TCHAR* SmsReceiver,
	                          const TCHAR* SmsContent,
	                          const TCHAR* SmsSubject);
	BOOL LanchSymtemEmailEditor(const TCHAR* EmailAddress,
	                            const TCHAR* Subject,
	                            const TCHAR* EmailBody);
	BOOL LanchSystemMMSEditor(const TCHAR* SmsReceiver,
	                          const TCHAR* SmsContent,
	                          const TCHAR* SmsSubject);

	void FullScreen(HWND hwnd, bool bFullScreen);

	LPCRECT	GetLCDRect();

	BOOL IsPocketPC();

	BOOL ModifyBackKey(HWND hWnd, bool bBack);

	void ShowSipButton(bool bShow);

	LPCTSTR LoadTextResource(HINSTANCE hIns, LPCTSTR lpszType, UINT nID);

	BOOL OpenURL(LPCTSTR lpURL);
	BOOL OpenURL(LPCSTR lpURL);

	BOOL GetModulePath(LPTSTR lpGet, int nLen, HMODULE hModule = NULL);
	BOOL GetFilePath(LPCTSTR lpstrFile, LPTSTR lpstrPath, int iPathLen);
	BOOL GetCHWordSizeInWindow(LPSIZE lpGet,
	                           LPCTSTR lpText = NULL,
	                           int iCount = -1,
	                           HWND hWnd = NULL);

	HBITMAP	LoadImageFile(LPCTSTR lpFile);

	HWND GetPlazaWindow();

	CStringA UTF16toUTF8(LPCWSTR lpstrUtf16);

	CStringW UTF8toUTF16(LPCSTR lpstrUtf8);

#ifdef _DEBUG
	void _cdecl MTrace(LPCTSTR lpszFormat, ...);
#endif
};

#ifdef _DEBUG
#define MTRACE CETool::MTrace
#else
#define MTRACE __noop
#endif
